#include"folding_tester_mainWin/mainWin.h"


//结果计算 log10^x x是耐折次数
#define TABLE_WIDTH 300
#define TABLE_HEIGHT


lv_style_t style_btn_start;  //开始测试按钮的style

lv_obj_t *main_cont;  
lv_obj_t *welcome_cont;
uint8_t language; //1时 中文显示，2时 英文显示
uint16_t to_delete_all_result;


lv_obj_t *btn_select_chinese; //中文语言选择按钮
lv_obj_t *btn_select_english;//英文语言选择按钮
lv_obj_t *label4;



static const char * btnm_map[] = {"1", "2", "3", "4", "5", "\n",
                                  "6", "7", "8", "9", "0", "\n",
                                  ".","清除", "取消", "确定",""};//键盘字符

static const char * btnm_map1[] = {"1", "2", "3", "4", "5", "\n",
                                  "6", "7", "8", "9", "0", "\n",
                                  ".","BK", "Cancel", "Enter",""};//键盘字符
lv_obj_t * btnm_keyBord;//键盘
char keyBord_target = 0; //1是更改次数 2是更改张力
lv_obj_t *keyBord_labe1;//键盘label
lv_obj_t * cont_keyBord;//键盘cont_keyBord
																	
																	
lv_obj_t *label_times;  //时间显示
lv_obj_t *label_date;   //时间显示

lv_obj_t *btn_testSetting_1; //横竖向指示框btn
lv_obj_t *label_testSetting_1;//横竖向指示框label
																	
lv_obj_t *btn_testSetting_2;    //折叠次数更改按钮
lv_obj_t *label_testSetting_2;  //折叠次数更改标签										
																	
lv_obj_t *btn_testSetting_3;    //实验张力更改按钮
lv_obj_t *label_testSetting_3;  //实验张力更改标签
																	
lv_obj_t *dp_testSetting_3;	

lv_obj_t *btn_upPage; //上一页按钮
lv_obj_t *label_upPage;//上一页字符标签
lv_obj_t *btn_nextPage;//下一页按钮
lv_obj_t *label_nextPage;//下一页字符标签

lv_obj_t *label_testedTimes;//已测次数字符标签
lv_obj_t *label_testSpeed;//实测速度字符标签

lv_obj_t *btn_reset;//复位按钮
lv_obj_t *btn_start;//启动按钮
lv_obj_t *label_btn_start;//启动按钮字符标签
lv_obj_t *btn_stop;//停止按钮
lv_obj_t *btn_deleteAll;//全部删除按钮
lv_obj_t *btn_deleteSelect;//删除结果按钮
lv_obj_t *btn_printReport;//打印报告按钮
lv_obj_t *label_printReport;//打印报告字符标签
lv_obj_t *btn_homePage;//首页按钮

lv_obj_t * cont_resultPage;//结果页码显示容器
lv_obj_t *label_resultPage;//结果页码显示标签

lv_obj_t  *btn_setting;			 //设置按钮
lv_obj_t *label_btn_setting;  //设置按钮标签


lv_obj_t *label_welcomWin_productModel;//主界面设备名

//all style definition
static lv_style_t style_label_base;



lv_obj_t *mbox_warning;
lv_style_t style_mbox1;

lv_obj_t *mbox_setting;
lv_style_t style_mbox1;

lv_obj_t * cont_main_top;//主界面，上部分cont
lv_obj_t *cont_main_top_label_font24;// 主界面，上方部分labelfont24

uint8_t is_mbox_hint_show = 0;

static void btn_mbox_warning_handler(lv_obj_t * obj, lv_event_t event)
{
	
	if((lv_obj_get_parent(obj) == mbox_warning) && (event == LV_EVENT_CLICKED))
	{
		beep_sound_tiems += BUTTON_BEEP_SOUND;
		is_mbox_hint_show = 0;
	lv_mbox_start_auto_close(lv_obj_get_parent(obj), 10);
	}
}


void mbox_hint_show(char *ch)
{

		if(is_mbox_hint_show == 1)
		{
			return;
		}
		beep_sound_tiems += BUTTON_BEEP_SOUND;
	  is_mbox_hint_show = 1;
	
		static lv_style_t style_mbox1;
    mbox_warning = lv_mbox_create(lv_scr_act(),NULL);
		lv_style_copy(&style_mbox1,lv_mbox_get_style(mbox_warning,LV_MBOX_STYLE_BG));
		style_mbox1.text.font = &font16;
		lv_mbox_set_style(mbox_warning,LV_MBOX_STYLE_BG,&style_mbox1);
		lv_mbox_set_text(mbox_warning,ch);
    lv_obj_t *btn_ensure = lv_btn_create(mbox_warning,NULL);
		lv_obj_set_size(btn_ensure,150,50);
    lv_obj_t *label_ensure = lv_label_create(btn_ensure,NULL);
    lv_label_set_style(label_ensure,LV_LABEL_STYLE_MAIN,&style_label_base);
		if(language == 1)
		{
			lv_label_set_text(label_ensure,"确定");
		}else
		{
			lv_label_set_text(label_ensure,"Ok");
		}
    
		lv_obj_set_event_cb(btn_ensure,btn_mbox_warning_handler);
}

uint8_t is_show_mbox_tension_sel = 0;
lv_obj_t *mbox_tension_sel;
lv_obj_t *btn1_mbox_tension_sel;
lv_obj_t *btn2_mbox_tension_sel;
lv_obj_t *btn3_mbox_tension_sel;

void mbox_show_tension_sel_handle(lv_obj_t *obj, lv_event_t event)
{
	
	if(event == LV_EVENT_CLICKED)
	{
		beep_sound_tiems += BUTTON_BEEP_SOUND;
        if(obj == btn1_mbox_tension_sel )
        {
            lv_label_set_text(label_testSetting_3,"4.91N");
						mit_parment.test_tension = 4.91;
						is_show_mbox_tension_sel = 0;
					lv_obj_del(lv_obj_get_parent(obj));
				//		lv_mbox_start_auto_close(lv_obj_get_parent(obj), 10);
        }else if (obj == btn2_mbox_tension_sel)
        {
            lv_label_set_text(label_testSetting_3,"9.81N");
					mit_parment.test_tension = 9.81;
						is_show_mbox_tension_sel = 0;
						lv_obj_del(lv_obj_get_parent(obj));
					//	lv_mbox_start_auto_close(lv_obj_get_parent(obj), 10);
        }else if (obj == btn3_mbox_tension_sel)
        {
            lv_label_set_text(label_testSetting_3,"14.72N");
					mit_parment.test_tension = 14.72;
						is_show_mbox_tension_sel = 0;
						lv_obj_del(lv_obj_get_parent(obj));
				//		lv_mbox_start_auto_close(lv_obj_get_parent(obj), 10);
        }
				flash_parment_write();
			}
}


void mbox_show_tension_sel()
{
	if(is_show_mbox_tension_sel == 1)
	{
		return;
	}else
	{
		is_show_mbox_tension_sel =1; 
	}
    static lv_style_t style_mbox_tension_sel;
    mbox_tension_sel = lv_mbox_create(main_cont,NULL);
		lv_obj_set_click(mbox_tension_sel,false);
    lv_style_copy(&style_mbox_tension_sel,lv_mbox_get_style(mbox_tension_sel,LV_MBOX_STYLE_BG));
    style_mbox_tension_sel.text.font = &font16;
    lv_mbox_set_style(mbox_tension_sel,LV_MBOX_STYLE_BG, &style_mbox_tension_sel);

    if(language == 1)
    {
        lv_mbox_set_text(mbox_tension_sel,"请选取测试张力");
    }else if(language == 2)
    {
        lv_mbox_set_text(mbox_tension_sel,"Please select test tension");
    }
    btn1_mbox_tension_sel = lv_btn_create(mbox_tension_sel,NULL);
    btn2_mbox_tension_sel = lv_btn_create(mbox_tension_sel,btn1_mbox_tension_sel);
    btn3_mbox_tension_sel = lv_btn_create(mbox_tension_sel,btn1_mbox_tension_sel);
    lv_obj_set_size(btn1_mbox_tension_sel,150,50);
		lv_obj_set_size(btn2_mbox_tension_sel,150,50);
		lv_obj_set_size(btn3_mbox_tension_sel,150,50);

    lv_obj_t *label_btn1;
    label_btn1 = lv_label_create(btn1_mbox_tension_sel,NULL);
    static lv_style_t style_label;
    lv_style_copy(&style_label,lv_label_get_style(label_btn1,LV_LABEL_STYLE_MAIN));
    style_label.text.font = &font16;

    lv_obj_t *label_btn2;
    label_btn2 = lv_label_create(btn2_mbox_tension_sel,label_btn1);
    lv_obj_t *label_btn3;
    label_btn3 = lv_label_create(btn3_mbox_tension_sel,label_btn1);

    lv_label_set_text(label_btn1,"4.91N");
    lv_label_set_text(label_btn2,"9.81N");
    lv_label_set_text(label_btn3,"14.72N");

    lv_obj_set_event_cb(btn1_mbox_tension_sel,mbox_show_tension_sel_handle);
		lv_obj_set_event_cb(btn2_mbox_tension_sel,mbox_show_tension_sel_handle);
		lv_obj_set_event_cb(btn3_mbox_tension_sel,mbox_show_tension_sel_handle);

}


static int8_t kb_ch_count;
static void btnm_keyBord_event_handler(lv_obj_t * obj, lv_event_t event) //键盘按键按下处理函数
{
		
    if(event == LV_EVENT_CLICKED) 
			{
				beep_sound_tiems += BUTTON_BEEP_SOUND;
        const char * txt = lv_btnm_get_active_btn_text(obj);
        if(txt == NULL)return;
        if(strcmp(txt,"清除") == 0 || strcmp(txt,"BK") == 0)
        {
            if(kb_ch_count >= 0)
            {
                lv_obj_align(keyBord_labe1,btnm_keyBord,LV_ALIGN_IN_TOP_MID,0,-35);

                //此处删除字符可能框架加bug 得下标加4才能删除到最后一个
                lv_label_cut_text(keyBord_labe1,kb_ch_count,1);
                --kb_ch_count;
            }
        }else if(strcmp(txt,"取消") == 0 || strcmp(txt,"Cancel") == 0)
        {
             for(;kb_ch_count>=0;kb_ch_count--)
             {
                 lv_label_cut_text(keyBord_labe1,kb_ch_count,1);
             }
						 keyBord_target = 0;
							task_close_keybord_create();
        }else if(strcmp(txt,"确定") == 0 || strcmp(txt,"Enter") == 0)
        {
            switch (keyBord_target)
            {
							case 1: lv_label_set_text_fmt(label_testSetting_2,"%d",(atoi(lv_label_get_text(keyBord_labe1))>999999)?999999:atoi(lv_label_get_text(keyBord_labe1)));//参数范围限制
										//lv_label_set_text(label_testSetting_2,lv_label_get_text(keyBord_labe1));
										mit_parment.test_target_num = (atoi(lv_label_get_text(keyBord_labe1))>999999)?999999:atoi(lv_label_get_text(keyBord_labe1));
										flash_parment_write();
                    lv_label_set_text(keyBord_labe1,0);
                    keyBord_target = 0;
                break;
            case 2: lv_label_set_text(label_testSetting_3,lv_label_get_text(keyBord_labe1));
                    lv_label_ins_text(label_testSetting_3,LV_LABEL_POS_LAST,"N");
                    keyBord_target = 0;
                break;
						case change_year:
								lv_label_set_text(label_btn_year,lv_label_get_text(keyBord_labe1));
								lv_label_set_text(keyBord_labe1,0);
								keyBord_target = 0;
							break;
						case change_month:
								lv_label_set_text(label_btn_month,lv_label_get_text(keyBord_labe1));
								lv_label_set_text(keyBord_labe1,0);
								keyBord_target = 0;
							break;
						case change_day:
								lv_label_set_text(label_btn_day,lv_label_get_text(keyBord_labe1));
								lv_label_set_text(keyBord_labe1,0);
								keyBord_target = 0;
							break;					
						case change_hour:
								lv_label_set_text(label_btn_hour,lv_label_get_text(keyBord_labe1));
								lv_label_set_text(keyBord_labe1,0);
								keyBord_target = 0;
							break;		
						case change_minute:
								lv_label_set_text(label_btn_minute,lv_label_get_text(keyBord_labe1));
								lv_label_set_text(keyBord_labe1,0);
								keyBord_target = 0;
							break;				
						case change_second:
								lv_label_set_text(label_btn_second,lv_label_get_text(keyBord_labe1));
								lv_label_set_text(keyBord_labe1,0);
								keyBord_target = 0;
							break;							
            default:
                break;
            }
            for(;kb_ch_count>=0;kb_ch_count--)
            {
                lv_label_cut_text(keyBord_labe1,kb_ch_count,1);
            }
            task_close_keybord_create();
        }else
        {
            lv_label_ins_text(keyBord_labe1,LV_LABEL_POS_LAST,txt);
            lv_obj_align(keyBord_labe1,btnm_keyBord,LV_ALIGN_IN_TOP_MID,0,-35);
            ++kb_ch_count;
        }
    }
}

//

//按钮事件处理函数
static void btn_event_handle(lv_obj_t * obj, lv_event_t event)
{
	
    //
	if(event  != LV_EVENT_RELEASED)return;
	
	beep_sound_tiems += BUTTON_BEEP_SOUND;
	
    if(obj == btn_testSetting_1)
    {
			if(test_state == TEST_START)
				{
					return;
				}

					if(result_table[3].index != 0)
					{
						if(language == 1)
						{
							mbox_hint_show("删除全部测试结果方可设置");
						}else if(language == 2)
						{
							mbox_hint_show("Delete all test results before setting");
						}
						return;
					}
            if(language == 1)
            {
                char *ch = lv_label_get_text(label_testSetting_1);
                if(strcmp(ch, "横 向") == 0)
                {
                    lv_label_set_text(label_testSetting_1,"竖 向");
										mit_parment.test_dir = 1;
                }else
                {
                    lv_label_set_text(label_testSetting_1,"横 向");
									mit_parment.test_dir = 0;
                }
								
            }else if(language == 2)
            {
                char *ch = lv_label_get_text(label_testSetting_1);
                if(strcmp(ch, "Crosswise") == 0)
                {
                    lv_label_set_text(label_testSetting_1,"Vertical");
									mit_parment.test_dir = 1;
                }else
                {
                    lv_label_set_text(label_testSetting_1,"Crosswise");
									mit_parment.test_dir = 0;
                }
            }
						flash_parment_write();
        return;
    }
    if(obj == btn_testSetting_2) //折叠次数更改按钮召唤出按钮
    {
			if(test_state == TEST_START)
			{
				return;
			}
        keyBord_target = 1;
        lv_obj_set_hidden(cont_keyBord,false);
        lv_obj_move_foreground(cont_keyBord);

        return;
    }
    if(obj == btn_testSetting_3)//实验张力更改按钮召唤出按钮
    {
			if(test_state == TEST_START)
			{
				return;
			}
			mbox_show_tension_sel();
//        keyBord_target = 2;
//        lv_obj_set_hidden(cont_keyBord,false);
//        lv_obj_move_foreground(cont_keyBord);

        return;
    }

    if(obj == btn_upPage && event == LV_EVENT_RELEASED)//上一页按钮
    {
        if(result_page > 0)
        {
            result_select_btn_reset();
            for(uint8_t i = 0; i < 31; ++i)
            {
                result_table[result_page+i].is_select = 0;
            }
            --result_page;
        }
        lv_label_set_text_fmt(label_resultPage,"%d",result_page+1);

      resualt_disp();
      return;
    }

    if(obj == btn_nextPage && event == LV_EVENT_RELEASED)//下一页按钮
    {
      if(result_page < 2)
      {
          result_select_btn_reset();
          for(uint8_t i = 0; i < 31; ++i)
          {
              result_table[i].is_select = 0;

          }
          ++result_page;
      }
      lv_label_set_text_fmt(label_resultPage,"%d",result_page+1);

      resualt_disp();
      return;
    }

    if(obj == btn_reset && event == LV_EVENT_RELEASED)//复位按钮
    {
			if((HAL_GPIO_ReadPin(EXI_1_GPIO_Port,EXI_1_Pin) == GPIO_PIN_RESET))return;
			Reset_run();
			lv_btn_set_state(btn_reset,LV_BTN_STATE_PR);
			lv_btn_set_state(btn_start,LV_BTN_STATE_INA);
			lv_btn_set_state(btn_homePage,LV_BTN_STATE_INA);
			
			lv_obj_set_click(btn_start,false);
			lv_obj_set_click(btn_homePage,false);
      return;
    }

    if(obj == btn_start && event == LV_EVENT_RELEASED)//启动按钮
    {
			if(1 > atoi(lv_label_get_text(label_testSetting_2)))
			{
					if(language == 1)
					{
						mbox_hint_show("测试次数必须大于零！");
					}else if(language == 2)
					{
						mbox_hint_show("The tests number  must be greater than zero!");
					}
					return;
			}
			if(((HAL_GPIO_ReadPin(EXI_1_GPIO_Port,EXI_1_Pin) == GPIO_PIN_SET)  || (HAL_GPIO_ReadPin(EXI_2_GPIO_Port,EXI_2_Pin) != GPIO_PIN_SET)))
			{
				if(is_mbox_hint_show == 1)return;
				if((HAL_GPIO_ReadPin(EXI_1_GPIO_Port,EXI_1_Pin) == GPIO_PIN_SET))
				{
					if(language == 1)
					{
						mbox_hint_show("请复位设备再开始测试！");
					}else if(language == 2)
					{
						mbox_hint_show("Please reset the device!");
					}
				}else if((HAL_GPIO_ReadPin(EXI_2_GPIO_Port,EXI_2_Pin) != GPIO_PIN_SET))
				{
					if(language == 1)
					{
						mbox_hint_show("请装载砝码再开始测试！");
					}else if(language == 2)
					{
						mbox_hint_show("Please load the weight!");
					}
				
				}
				return;
			}

			lv_btn_set_state(btn_start,LV_BTN_STATE_PR);
			lv_btn_set_state(btn_reset,LV_BTN_STATE_INA);
			lv_btn_set_state(btn_homePage,LV_BTN_STATE_INA);
			lv_btn_set_state(btn_setting,LV_BTN_STATE_INA);
			lv_obj_set_click(obj,false);
			lv_obj_set_click(btn_reset,false);
			lv_obj_set_click(btn_homePage,false);
			lv_obj_set_click(btn_setting,false);
			Test_Start(atoi(lv_label_get_text(label_testSetting_2)));
      return;
    }

    if(obj == btn_stop && event == LV_EVENT_RELEASED)//停止按钮
    {
			lv_btn_set_state(btn_start,LV_BTN_STATE_REL);
			lv_btn_set_state(btn_reset,LV_BTN_STATE_REL);
			lv_btn_set_state(btn_homePage,LV_BTN_STATE_REL);
			lv_btn_set_state(btn_setting,LV_BTN_STATE_REL);
			lv_obj_set_click(btn_start,true);
			lv_obj_set_click(btn_reset,true);
			lv_obj_set_click(btn_homePage,true);
			lv_obj_set_click(btn_setting,true);
			if(test_state == TEST_START)
			{
				add_result(Test_Stop());
			}else if(test_state == TEST_RESETING)
			{
				Test_Stop();
			}
			
      return;
    }

    if(obj == btn_deleteAll && event == LV_EVENT_RELEASED)//全部删除按钮
    {
			//to_delete_all_result;
      return;
    }

    if(obj == btn_deleteSelect && event == LV_EVENT_RELEASED)//删除结果按钮
    {
			delete_select_result();
      return;
    }

    if(obj == btn_printReport && event == LV_EVENT_RELEASED)//打印报告按钮
    {
			print_report();
      return;
    }

    if(obj == btn_homePage && event == LV_EVENT_RELEASED)//首页按钮
    {
      lv_obj_del(main_cont);
			lv_task_del(task_rtc_update);
			lv_task_del(task_ui_update);
      first_cont();


      return;
    }
    if(obj == btn_setting && event == LV_EVENT_RELEASED)
    {
			show_cont_setting();
      return;
    }
}




void welcom_btn_event_handle(lv_obj_t *obj,lv_event_t event)
{
	
    if(obj == btn_select_chinese && event == LV_EVENT_CLICKED)//首页按钮
    {
			beep_sound_tiems += BUTTON_BEEP_SOUND;
     lv_obj_del(welcome_cont);
     language = 1;
     top_cont();
     return;
    }

    if(obj == btn_select_english && event == LV_EVENT_CLICKED)//首页按钮
    {
      lv_obj_del(welcome_cont);
      language = 2;
      top_cont();
      return;
    }
}

void first_cont()
{
	
    welcome_cont = lv_cont_create(lv_scr_act(),NULL);
    lv_obj_set_size(welcome_cont,800,480);

    lv_obj_t * img1 = lv_img_create(welcome_cont, NULL);
    lv_img_set_src(img1, &welcome_img);
    lv_obj_set_size(img1,800,480);
    lv_obj_set_pos(img1,0,0);

    btn_select_chinese  = lv_btn_create(welcome_cont,NULL);
    lv_obj_set_pos(btn_select_chinese,150,290);
    lv_obj_set_size(btn_select_chinese,150,60);
    static lv_style_t style2;
    lv_obj_t *label2 = lv_label_create(btn_select_chinese, NULL);
    lv_style_copy(&style2,lv_label_get_style(label2,LV_LABEL_STYLE_MAIN));
    style2.text.font = &font16;
    lv_label_set_style(label2,LV_LABEL_STYLE_MAIN,&style2);
    lv_label_set_align(label2,LV_ALIGN_CENTER);
    lv_label_set_text(label2,"中文");
    lv_obj_set_event_cb(btn_select_chinese,welcom_btn_event_handle);

    btn_select_english  = lv_btn_create(welcome_cont,NULL);
    lv_obj_set_pos(btn_select_english,525,290);
    lv_obj_set_size(btn_select_english,150,60);
    lv_obj_t *label3 = lv_label_create(btn_select_english, NULL);
    lv_label_set_style(label3,LV_LABEL_STYLE_MAIN,&style2);
    lv_label_set_align(label3,LV_ALIGN_CENTER);
    lv_label_set_text(label3,"English");
    lv_obj_set_event_cb(btn_select_english,welcom_btn_event_handle);

    lv_obj_t *label_welcomWin_productModel = lv_label_create(welcome_cont, NULL);
    lv_obj_set_pos(label_welcomWin_productModel, 70, 100);
    lv_obj_set_size(label_welcomWin_productModel, 70, 100);
    static lv_style_t style1;
    lv_style_copy(&style1,lv_label_get_style(label_welcomWin_productModel,LV_LABEL_STYLE_MAIN));
    style1.text.font = &font28;
    lv_label_set_style(label_welcomWin_productModel,LV_LABEL_STYLE_MAIN,&style1);
    lv_label_set_text(label_welcomWin_productModel,"MIT 耐 折 检 测 仪");
    lv_label_set_align(label_welcomWin_productModel,LV_LABEL_ALIGN_CENTER);
    lv_obj_align(label_welcomWin_productModel,NULL,LV_ALIGN_CENTER,0,-120);

    lv_obj_t *label31 = lv_label_create(welcome_cont, NULL);
    lv_obj_set_pos(label31, 70, 100);
    lv_obj_set_size(label31, 80, 100);
    static lv_style_t style3;
    lv_style_copy(&style3,lv_label_get_style(label_welcomWin_productModel,LV_LABEL_STYLE_MAIN));
    style3.text.font = &font24;
    lv_label_set_style(label31,LV_LABEL_STYLE_MAIN,&style3);
    lv_label_set_text(label31,"MIT floding tester");
    lv_label_set_align(label31,LV_LABEL_ALIGN_CENTER);
    lv_obj_align(label31,NULL,LV_ALIGN_CENTER,0,-80);

    lv_obj_t *label32 = lv_label_create(welcome_cont, label_welcomWin_productModel);
    lv_obj_set_pos(label32, 70, 100);
    lv_obj_set_size(label32, 80, 100);
    lv_label_set_text(label32,"HD-A519");
    lv_obj_align(label32,NULL,LV_ALIGN_CENTER,0,-40);
		

}

void top_cont()
{
	char ch[10] = {0};
	
    main_cont = lv_cont_create(lv_scr_act(),NULL);
    lv_obj_set_size(main_cont,800,480);
    //var init
    kb_ch_count = -1;
    result_page = 0;
    //键盘部分
    btnm_keyBord = lv_btnm_create(main_cont, NULL);

    static lv_style_t style13;
    lv_style_copy(&style13,lv_btnm_get_style(btnm_keyBord,LV_BTNM_STYLE_BTN_REL));

    lv_btnm_set_style(btnm_keyBord,LV_BTNM_STYLE_BTN_REL,&style13);

    if(language == 1)
    {
        style13.text.font = &font16;
        lv_btnm_set_map(btnm_keyBord, btnm_map);
    }else
    {
        lv_btnm_set_map(btnm_keyBord, btnm_map1);
    }
    static lv_style_t style14;
    lv_style_copy(&style14,lv_btnm_get_style(btnm_keyBord,LV_BTNM_STYLE_BTN_PR));
    style14.text.font = &font16;
    style14.body.grad_color = LV_COLOR_GREEN;
    lv_btnm_set_style(btnm_keyBord,LV_BTNM_STYLE_BTN_PR,&style14);

    lv_btnm_set_btn_width(btnm_keyBord, 12, 2);        /*Make "Action1" twice as wide as "Action2"*/
    lv_obj_align(btnm_keyBord, NULL, LV_ALIGN_CENTER, 0, 0);
    cont_keyBord = lv_cont_create(main_cont, NULL);
    lv_obj_set_size(cont_keyBord,lv_obj_get_width(btnm_keyBord),lv_obj_get_height(btnm_keyBord)+50);
    lv_obj_set_pos(cont_keyBord,150,50);

    lv_obj_set_parent(btnm_keyBord,cont_keyBord);
    lv_obj_align(btnm_keyBord, NULL, LV_ALIGN_CENTER, 0, 30);
    lv_obj_set_drag(cont_keyBord, true);


    keyBord_labe1 = lv_label_create(cont_keyBord,NULL);

    lv_obj_align(keyBord_labe1,btnm_keyBord,LV_ALIGN_IN_TOP_MID,0,-35);
    lv_obj_set_size(keyBord_labe1,lv_obj_get_x(btnm_keyBord),5);
    static lv_style_t style12;
    lv_style_copy(&style12,lv_label_get_style(keyBord_labe1,LV_LABEL_STYLE_MAIN));
    style12.text.font = &font16;
    lv_label_set_style(keyBord_labe1,LV_LABEL_STYLE_MAIN,&style12);
    lv_label_set_text(keyBord_labe1,""); //当label的初始值为null时，会默认设置label的字符为 Text
    lv_obj_set_event_cb(btnm_keyBord,btnm_keyBord_event_handler);

        lv_obj_set_hidden(cont_keyBord,true);
        lv_obj_move_background(cont_keyBord);

    //lv_obj_set_hidden()



    //主界面部分
   
    cont_main_top = lv_cont_create(main_cont, NULL);
    lv_obj_set_size(cont_main_top, 800, 67);
    lv_obj_set_click(cont_main_top, false);

    static lv_style_t style0;
    lv_style_copy(&style0, lv_cont_get_style(cont_main_top,LV_CONT_STYLE_MAIN));
    style0.body.border.color = LV_COLOR_BLUE;
    style0.body.border.opa = 255;
    style0.body.border.width = 3;
    lv_cont_set_style(cont_main_top,LV_CONT_STYLE_MAIN,&style0);


    lv_obj_t * img1 = lv_img_create(cont_main_top, NULL);
    lv_img_set_src(img1, &HDimg);
    lv_obj_set_size(img1,55,55);
    lv_obj_set_pos(img1,5,5);


    cont_main_top_label_font24 = lv_label_create(main_cont, NULL);
    lv_obj_set_pos(cont_main_top_label_font24, 70, 100);
    lv_obj_set_size(cont_main_top_label_font24, 70, 100);
    static lv_style_t style1;
    lv_style_copy(&style1,lv_label_get_style(cont_main_top_label_font24,LV_LABEL_STYLE_MAIN));
    style1.text.font = &font24;
    lv_label_set_style(cont_main_top_label_font24,LV_LABEL_STYLE_MAIN,&style1);
    lv_label_set_text(cont_main_top_label_font24,"海达仪器");
    lv_obj_set_pos(cont_main_top_label_font24,60,10);


    static lv_style_t style2;
    lv_obj_t *label2 = lv_label_create(main_cont, NULL);
    lv_style_copy(&style2,lv_label_get_style(label2,LV_LABEL_STYLE_MAIN));

    if(language == 1)
    {
        style2.text.font = &font16;
    }
    lv_label_set_style(label2,LV_LABEL_STYLE_MAIN,&style2);
    lv_obj_set_size(label2, 70, 100);






    //
    lv_obj_t  * cont1 = lv_cont_create(main_cont, NULL);
    static lv_style_t style4;
    lv_style_copy(&style4,lv_cont_get_style(cont1,LV_CONT_STYLE_MAIN));
    //style4.body.border.color = LV_COLOR_BLUE;
    style4.body.main_color = LV_COLOR_BLUE;
    style4.body.border.width = 3;

//    lv_style_set_bg_color(&style4, LV_STATE_DEFAULT, LV_COLOR_BLUE);
//    lv_style_set_border_width(&style4, LV_STATE_DEFAULT, 3);



     lv_cont_set_layout(cont1,LV_LAYOUT_CENTER);
     lv_cont_set_style(cont1,LV_CONT_STYLE_MAIN,&style4);
   // lv_obj_add_style(cont1, LV_CONT_PART_MAIN, &style4);
    lv_obj_set_size(cont1, 46, 24);
    lv_obj_set_pos(cont1,570,6);
    lv_obj_set_click(cont_main_top, false);

    static lv_style_t style3;
    lv_obj_t *label3 = lv_label_create(cont1, NULL);
    lv_style_copy(&style3,lv_label_get_style(label3,LV_LABEL_STYLE_MAIN));

    style3.text.color = LV_COLOR_WHITE;

    if(language == 1)
    {
        style3.text.font = &font16;
    }

    lv_label_set_style(label3,LV_LABEL_STYLE_MAIN,&style3);
    lv_label_set_align(label3,LV_ALIGN_CENTER);

    //时间标识
    lv_obj_t * cont2;
    cont2 = lv_cont_create(main_cont, cont1);
    lv_obj_set_pos(cont2,570,34);
    lv_obj_set_click(cont2, false);

    label4 = lv_label_create(cont2, label3);


    //时间显示
    lv_obj_t * cont3;
    cont3 = lv_cont_create(main_cont, cont_main_top);

    lv_obj_set_size(cont3,100,24 );
    lv_obj_set_pos(cont3,620,34);
    lv_obj_set_click(cont3, false);
    lv_cont_set_layout(cont3,LV_LAYOUT_CENTER);
		label_times = lv_label_create(cont3, NULL);
    lv_label_set_text_fmt(label_times, "%d : %d : %d", 15,21,3);



    //日期显示
    lv_obj_t * cont4 = lv_cont_create(main_cont, cont3);
    lv_obj_set_size(cont4,100,24 );
    lv_obj_set_pos(cont4,620,6);

    label_date = lv_label_create(cont4, NULL);
    lv_label_set_text_fmt(label_date, "%d : %d : %d", 15,21,3);

    //星期标识





    //星期显示


     static lv_style_t style5;
     lv_style_copy(&style5,&style3);
    style5.text.color = LV_COLOR_BLACK;
    if(language == 1)
    {
        style5.text.font = &font16;
    }






    //结果表格
    /*Create a normal cell style*/
    static lv_style_t style_cell1;
    lv_style_copy(&style_cell1, &lv_style_plain);
    style_cell1.body.border.width = 1;
    style_cell1.body.border.color = LV_COLOR_SILVER;
    style_cell1.text.color = LV_COLOR_BLUE;
    style_cell1.text.font = &font16;

    /*Crealte a header cell style*/
    static lv_style_t style_cell2;
    lv_style_copy(&style_cell2, &lv_style_plain);
    style_cell2.body.border.width = 1;
    style_cell2.body.border.color = LV_COLOR_YELLOW;
    style_cell2.body.main_color = LV_COLOR_SILVER;
    style_cell2.body.grad_color = LV_COLOR_SILVER;
    style_cell2.text.color = LV_COLOR_RED;
    style_cell2.text.font = &font16;

    /*Create a normal cell style*/
    static lv_style_t style_cell3;
    lv_style_copy(&style_cell3, &lv_style_plain);
    style_cell3.body.border.width = 1;
    style_cell3.body.border.color = LV_COLOR_SILVER;
    style_cell3.text.color = LV_COLOR_BLUE;
    style_cell3.body.main_color = LV_COLOR_ORANGE;
    style_cell3.body.grad_color = LV_COLOR_ORANGE;
    style_cell3.text.font = &font16;


    table_result = lv_table_create(main_cont, NULL);
    lv_table_set_style(table_result, LV_TABLE_STYLE_CELL1, &style_cell1);
    lv_table_set_style(table_result, LV_TABLE_STYLE_CELL2, &style_cell2);
//    lv_table_set_style(table_result, LV_TABLE_STYLE_CELL3, &style_cell3);
    lv_table_set_style(table_result, LV_TABLE_STYLE_BG, &lv_style_transp_tight);
    lv_table_set_col_cnt(table_result, 3);
    lv_table_set_row_cnt(table_result, 11);
    lv_obj_set_pos(table_result,0,67);
    lv_obj_set_size(table_result,300,130);
		lv_table_set_col_width(table_result,0,80);
		lv_table_set_col_width(table_result,1,130);
    lv_table_set_col_width(table_result,2,135);
    /*Make the cells of the first row center aligned */
    for(int i = 0; i< 3; ++i)
    {
        for(int j = 0; j <11; ++j)
        {
            lv_table_set_cell_align(table_result, j, i, LV_LABEL_ALIGN_CENTER);
        }
    }

    /*Make the cells of the first row TYPE = 2 (use `style_cell2`) */
    lv_table_set_cell_type(table_result, 0, 0, 2);
    lv_table_set_cell_type(table_result, 0, 1, 2);
    lv_table_set_cell_type(table_result, 0, 2, 2);

    /*Fill the first column*/



    //结果列表选取按钮
    static lv_style_t style6;
    static lv_style_t style7;

    btn_resultSelect_1 = lv_btn_create(main_cont,NULL);
    lv_btn_set_toggle(btn_resultSelect_1,true);
    lv_style_copy(&style6,lv_btn_get_style(btn_resultSelect_1,LV_BTN_STYLE_TGL_REL ));
    style6.body.border.opa = 0;
    style6.body.radius = 0;
    style6.body.opa = 0;

    lv_style_copy(&style7,&style6);
    style7.body.border.color = LV_COLOR_CYAN;
    style7.body.border.opa = 127;
    style7.body.border.width = 5;
    style7.body.radius = 0;
    style7.body.opa = 0;
    lv_btn_set_style(btn_resultSelect_1,LV_BTN_STYLE_REL,&style6);
    lv_btn_set_style(btn_resultSelect_1,LV_BTN_STYLE_PR,&style7);
    lv_btn_set_style(btn_resultSelect_1,LV_BTN_STYLE_TGL_PR,&style7);
    lv_btn_set_style(btn_resultSelect_1,LV_BTN_STYLE_TGL_REL,&style7);

    lv_obj_set_size(btn_resultSelect_1,340,34);
    lv_obj_set_pos(btn_resultSelect_1,0,69+34*1);
    lv_obj_set_event_cb(btn_resultSelect_1,btn_result_event_handle);
    btn_resultSelect_2 = lv_btn_create(main_cont,btn_resultSelect_1);
    lv_obj_set_size(btn_resultSelect_2,340,34);
    lv_obj_set_pos(btn_resultSelect_2,0,69+34*2);
    lv_obj_set_event_cb(btn_resultSelect_2,btn_result_event_handle);
    btn_resultSelect_3 = lv_btn_create(main_cont,btn_resultSelect_1);
    lv_obj_set_size(btn_resultSelect_3,340,34);
    lv_obj_set_pos(btn_resultSelect_3,0,69+34*3);
    lv_obj_set_event_cb(btn_resultSelect_3,btn_result_event_handle);
    btn_resultSelect_4 = lv_btn_create(main_cont,btn_resultSelect_1);
    lv_obj_set_size(btn_resultSelect_4,340,34);
    lv_obj_set_pos(btn_resultSelect_4,0,69+34*4);
    lv_obj_set_event_cb(btn_resultSelect_4,btn_result_event_handle);
    btn_resultSelect_5 = lv_btn_create(main_cont,btn_resultSelect_1);
    lv_obj_set_size(btn_resultSelect_5,340,34);
    lv_obj_set_pos(btn_resultSelect_5,0,69+34*5);
    lv_obj_set_event_cb(btn_resultSelect_5,btn_result_event_handle);
    btn_resultSelect_6 = lv_btn_create(main_cont,btn_resultSelect_1);
    lv_obj_set_size(btn_resultSelect_6,340,34);
    lv_obj_set_pos(btn_resultSelect_6,0,69+34*6);
    lv_obj_set_event_cb(btn_resultSelect_6,btn_result_event_handle);
    btn_resultSelect_7 = lv_btn_create(main_cont,btn_resultSelect_1);
    lv_obj_set_size(btn_resultSelect_7,340,34);
    lv_obj_set_pos(btn_resultSelect_7,0,69+34*7);
    lv_obj_set_event_cb(btn_resultSelect_7,btn_result_event_handle);
    btn_resultSelect_8 = lv_btn_create(main_cont,btn_resultSelect_1);
    lv_obj_set_size(btn_resultSelect_8,340,34);
    lv_obj_set_pos(btn_resultSelect_8,0,69+34*8);
    lv_obj_set_event_cb(btn_resultSelect_8,btn_result_event_handle);
    btn_resultSelect_9 = lv_btn_create(main_cont,btn_resultSelect_1);
    lv_obj_set_size(btn_resultSelect_9,340,34);
    lv_obj_set_pos(btn_resultSelect_9,0,69+34*9);
    lv_obj_set_event_cb(btn_resultSelect_9,btn_result_event_handle);
    btn_resultSelect_10 = lv_btn_create(main_cont,btn_resultSelect_1);
    lv_obj_set_size(btn_resultSelect_10,340,34);
    lv_obj_set_pos(btn_resultSelect_10,0,69+34*10);
		lv_obj_set_event_cb(btn_resultSelect_10,btn_result_event_handle);
    //上一页 下一页 按钮
    btn_upPage = lv_btn_create(main_cont,NULL);
    lv_obj_set_size(btn_upPage,340/2-23,34);
    lv_obj_set_pos(btn_upPage,0,69+34*11);
    btn_nextPage = lv_btn_create(main_cont,NULL);
		lv_obj_set_click(btn_nextPage,false);
    lv_obj_set_size(btn_nextPage,340/2-23,34);
    lv_obj_set_pos(btn_nextPage,340/2+23,69+34*11);
    lv_obj_t *label_upPage = lv_label_create(btn_upPage,NULL);
    
    lv_style_copy(&style_label_base,&style5);
   style_label_base.text.color = LV_COLOR_WHITE;
   lv_label_set_style(label_upPage,LV_LABEL_STYLE_MAIN,&style_label_base);
    lv_obj_t *label_nextPage = lv_label_create(btn_nextPage,label_upPage);


    lv_obj_set_event_cb(btn_upPage,btn_event_handle);
    lv_obj_set_event_cb(btn_nextPage,btn_event_handle);

    //结果页码显示
    cont_resultPage = lv_cont_create(main_cont, cont1);
    lv_obj_set_size(cont_resultPage, 46, 34);
    lv_obj_set_pos(cont_resultPage,340/2-23,69+34*11);

    label_resultPage = lv_label_create(cont_resultPage, label2);
    lv_label_set_style(label_resultPage,LV_LABEL_STYLE_MAIN,&style5);
    lv_label_set_text_fmt(label_resultPage,"%d",result_page+1);


    //测试选项 折叠方向 设定次数 试验张力
    static lv_style_t style8;
    lv_obj_t *cont7 = lv_cont_create(main_cont,cont_main_top);
    lv_style_copy(&style8,lv_cont_get_style(cont7,LV_CONT_STYLE_MAIN));
    style8.body.border.color = LV_COLOR_GRAY;
    lv_cont_set_style(cont7,LV_CONT_STYLE_MAIN,&style8);
    lv_obj_set_size(cont7,310,180);
    lv_obj_set_pos(cont7,340,67);

    static lv_style_t style9;
    lv_style_copy(&style9,&style5);
    style9.text.color = LV_COLOR_RED;

    lv_obj_t *label11 = lv_label_create(cont7,NULL);
    lv_label_set_style(label11,LV_LABEL_STYLE_MAIN,&style9);


    lv_obj_set_pos(label11,10,30);

    lv_obj_t *label12 = lv_label_create(cont7,label11);


    lv_obj_set_pos(label12,10,80);


    lv_obj_t *label13 = lv_label_create(cont7,label11);

    lv_obj_set_pos(label13,10,130);
    btn_testSetting_1 = lv_btn_create(cont7,NULL);
    static lv_style_t style10;
    lv_style_copy(&style10, lv_btn_get_style(btn_testSetting_1,LV_BTN_STYLE_REL));
    style10.body.opa = 0;
    style10.body.border.color = LV_COLOR_BLUE;
    lv_btn_set_style(btn_testSetting_1,LV_BTN_STYLE_REL,&style10);
    lv_obj_set_pos(btn_testSetting_1,150,30);
    lv_obj_set_size(btn_testSetting_1,120,35);
    label_testSetting_1 = lv_label_create(btn_testSetting_1,label_upPage);
    static lv_style_t style11;
    lv_style_copy(&style11,lv_label_get_style(label_testSetting_1,LV_LABEL_STYLE_MAIN));
    style11.text.color = LV_COLOR_BLACK;
    lv_label_set_style(label_testSetting_1,LV_LABEL_STYLE_MAIN,&style11);


    lv_obj_set_event_cb(btn_testSetting_1,btn_event_handle);

    btn_testSetting_2 = lv_btn_create(cont7,btn_testSetting_1);
    label_testSetting_2 = lv_label_create(btn_testSetting_2,label_testSetting_1);
    lv_obj_set_pos(btn_testSetting_2,150,80);
		
		
		sprintf(ch,"%d",mit_parment.test_target_num);
    lv_label_set_text(label_testSetting_2,ch);
    lv_obj_set_event_cb(btn_testSetting_2,btn_event_handle);
    btn_testSetting_3 = lv_btn_create(cont7,btn_testSetting_1);
    label_testSetting_3 = lv_label_create(btn_testSetting_3,label_testSetting_1);
    lv_obj_set_pos(btn_testSetting_3,150,130);
		
		
		
    sprintf(ch,"%.2f",mit_parment.test_tension);
		lv_label_set_text(label_testSetting_3,ch);
		lv_label_ins_text(label_testSetting_3,LV_LABEL_POS_LAST,"N");
		
    lv_obj_set_event_cb(btn_testSetting_3,btn_event_handle);
		
		
		
//张力设置

		
//    lv_obj_set_event_cb(dp_testSetting_3, event_handler);
		
		
	
    //已测次数 实测速度
    lv_obj_t *cont8 = lv_cont_create(main_cont,cont7);
    lv_obj_set_pos(cont8,340,67+180);
    lv_obj_set_size(cont8,310,230);

    lv_obj_t *label17 = lv_label_create(cont8,label11);


    lv_obj_set_pos(label17,20,40);

    lv_obj_t *btn13 = lv_btn_create(cont8,btn_testSetting_1);
    lv_obj_set_click(btn13,false);
    label_testedTimes = lv_label_create(btn13,label_testSetting_1);
    lv_obj_set_pos(btn13,20,70);
    lv_obj_set_size(btn13,200,35);
    lv_label_set_text(label_testedTimes,"");

    lv_obj_t *label19 = lv_label_create(cont8,label11);

    lv_obj_set_pos(label19,20,130);

    lv_obj_t *btn14 = lv_btn_create(cont8,btn13);
    lv_obj_set_click(btn14,false);
    label_testSpeed = lv_label_create(btn14,label_testSetting_1);
    lv_obj_set_pos(btn14,20,160);
    lv_label_set_text(label_testSpeed,"");

    //右侧 复位 启动 停止 全部删除 删除结果 打印报告 首页 按钮
    lv_obj_t *cont9 = lv_cont_create(main_cont,cont8);
    lv_obj_set_pos(cont9,648,67);
    lv_obj_set_size(cont9,150,410);


    btn_reset  = lv_btn_create(cont9,btn_upPage);
    lv_obj_set_pos(btn_reset,0,5);
    lv_obj_set_size(btn_reset,150,50);
    lv_obj_t *label21 = lv_label_create(btn_reset,label_upPage);


    lv_obj_set_event_cb(btn_reset,btn_event_handle);


    btn_start  = lv_btn_create(cont9,btn_reset);
		lv_style_copy(&style_btn_start,lv_obj_get_style(btn_start));
		style_btn_start.body.main_color = LV_COLOR_GREEN;
		lv_btn_set_style(btn_start,LV_BTN_STYLE_PR,&style_btn_start);
    lv_obj_set_pos(btn_start,0,63);
    lv_obj_t *label_btn_start = lv_label_create(btn_start,label_upPage);



    lv_obj_set_event_cb(btn_start,btn_event_handle);

    btn_stop  = lv_btn_create(cont9,btn_reset);
    lv_obj_set_pos(btn_stop,0,121);
    lv_obj_t *label23 = lv_label_create(btn_stop,label_upPage);

    lv_obj_set_event_cb(btn_stop,btn_event_handle);

    btn_deleteAll  = lv_btn_create(cont9,btn_reset);
    lv_obj_set_pos(btn_deleteAll,0,179);
    lv_obj_t *label24 = lv_label_create(btn_deleteAll,label_upPage);




    lv_obj_set_event_cb(btn_deleteAll,btn_event_handle);

    btn_deleteSelect  = lv_btn_create(cont9,btn_reset);
    lv_obj_set_pos(btn_deleteSelect,0,237);
    lv_obj_t *label25 = lv_label_create(btn_deleteSelect,label_upPage);


    lv_obj_set_event_cb(btn_deleteSelect,btn_event_handle);

    btn_printReport  = lv_btn_create(cont9,btn_reset);
    lv_obj_set_pos(btn_printReport,0,295);
    label_printReport = lv_label_create(btn_printReport,label_upPage);


    lv_obj_set_event_cb(btn_printReport,btn_event_handle);

    btn_homePage  = lv_btn_create(cont9,btn_reset);
    lv_obj_set_pos(btn_homePage,0,353);
    lv_obj_t *label27 = lv_label_create(btn_homePage,label_upPage);
    lv_obj_set_event_cb(btn_homePage,btn_event_handle);
		btn_setting = lv_btn_create(main_cont,btn_start);
    label_btn_setting = lv_label_create(btn_setting,label25);

    lv_obj_set_pos(btn_setting,730,3);
    lv_obj_set_size(btn_setting,65,60);


    if(language == 1)
    {

        lv_label_set_text(label2,"让每一家企业拥有高品质的检测仪器");
        lv_obj_set_pos(label2,200,20);
        lv_label_set_text(label3,"日期");
        lv_label_set_text(label4,"时间");
				lv_label_set_text(label_btn_setting,"设置");
        lv_table_set_cell_value(table_result, 0, 0, "序号");
        lv_table_set_cell_value(table_result, 0, 1, "耐折次数");
        lv_table_set_cell_value(table_result, 0, 2, "测量结果(log)");
        lv_table_set_cell_value(table_result, 1, 0, "最大值");
        lv_table_set_cell_value(table_result, 2, 0, "最小值");
        lv_table_set_cell_value(table_result, 3, 0, "平均值");
        lv_label_set_text(label_upPage,"上一页");
        lv_label_set_text(label_nextPage,"下一页");
        lv_label_set_text(label11,"1.折叠方向");
        lv_label_set_text(label12,"2.设定次数");
        lv_label_set_text(label13,"3.试验张力");
				if(mit_parment.test_dir == 0)
				{
					lv_label_set_text(label_testSetting_1,"横 向");
				}else
				{
					lv_label_set_text(label_testSetting_1,"竖 向");
				}
        
        lv_label_set_text(label17,"已测次数");
        lv_label_set_text(label19,"实测速度 次/分钟");
        lv_label_set_text(label21, "复位");
        lv_label_set_text(label_btn_start, "启动");
        lv_label_set_text(label23, "停止");
        lv_label_set_text(label24, "全部删除");
        lv_label_set_text(label25, "删除结果");
        lv_label_set_text(label_printReport, "打印报告");
        lv_label_set_text(label27, "首页");
    }else if(language == 2)
    {
        lv_label_set_text(label2,"Deliver The Best Testing \n Equipment To Our Customers");
        lv_label_set_align(label2,LV_LABEL_ALIGN_CENTER);
        lv_obj_set_pos(label2,270,15);
        lv_label_set_text(label3,"Date");
        lv_label_set_text(label4,"PM");
				lv_label_set_text(label_btn_setting,"Set");
        lv_table_set_cell_value(table_result, 0, 0, "Index");
        lv_table_set_cell_value(table_result, 0, 1, "Times");
        lv_table_set_cell_value(table_result, 0, 2, "Result");
        lv_table_set_cell_value(table_result, 1, 0, "Max");
        lv_table_set_cell_value(table_result, 2, 0, "Mini");
        lv_table_set_cell_value(table_result, 3, 0, "AVG");
        lv_label_set_text(label_upPage,"Page up");
        lv_label_set_text(label_nextPage,"Page down");
        lv_label_set_text(label11,"1.Floding direction");
        lv_label_set_text(label12,"2.Test number");
        lv_label_set_text(label13,"3. Test tension");

				if(mit_parment.test_dir == 0)
				{
					lv_label_set_text(label_testSetting_1,"Crosswise");
				}else
				{
					lv_label_set_text(label_testSetting_1,"Vertical");
				}			

        lv_label_set_text(label17,"Measured times");
        lv_label_set_text(label19,"Measured speed   Times/min");
        lv_label_set_text(label21, "Reset");
        lv_label_set_text(label_btn_start, "Start");
        lv_label_set_text(label23, "Stop");
        lv_label_set_text(label24, "Delete all result");
        lv_label_set_text(label25, "Delete result");
        lv_label_set_text(label_printReport, "Print report");
        lv_label_set_text(label27, "Home page");
    }
		test_state = 5;
		task_ui_update_create();
		task_rtc_update_create();

		flash_result_read();

	resualt_disp();

}


